//
//  CommentTableViewCell.m
//  Frame
//
//  Created by 这是工作本 on 16/1/14.
//  Copyright © 2016年 这是工作本. All rights reserved.
//

#import "CommentTableViewCell.h"

@implementation CommentTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubview];
    }
    return self;
}


- (void)createSubview
{
    //头像
    
    UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(10 * ScreenWidth, 10 * ScreenHeigth, 40 * ScreenWidth, 40 * ScreenHeigth)];
    image.image = [UIImage imageNamed:@"img_tx@2x.png"];
    image.layer.cornerRadius = 20 * ScreenWidth;
    image.layer.masksToBounds = YES;
    [self.contentView addSubview:image];
    
    
    
    
    //名字
    UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(image.frame.origin.x + image.frame.size.width + 10 * ScreenWidth, image.frame.origin.y , 100 * ScreenWidth, 30 * ScreenHeigth)];
    name.text = @"彩色_有个哥:";
    name.textColor = [UIColor colorWithRed:29 / 255.0 green:127 / 255.0 blue:140 / 255.0 alpha:1.0];
    name.font = [UIFont systemFontOfSize:15.0 * ScreenWidth];
    [self.contentView addSubview:name];
    
    
    
    //内容
    
    UILabel *content = [[UILabel alloc] initWithFrame:CGRectMake(name.frame.origin.x + name.frame.size.width, image.frame.origin.y - 8 * ScreenHeigth, 240 * ScreenWidth, 100 * ScreenHeigth)];
    content.text = @"送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费";
    content.textColor = [UIColor colorWithRed:30 / 255.0 green:30 /255.0 blue:30 / 255.0 alpha:1.0];
    content.numberOfLines = 0;
    content.lineBreakMode = NSLineBreakByTruncatingHead;
    content.font = [UIFont systemFontOfSize:15.0 * ScreenWidth];
    [self.contentView addSubview:content];

    
    
    
    //时间
    
    
    UILabel *time = [[UILabel alloc] initWithFrame:CGRectMake(name.frame.origin.x, image.frame.origin.y + image.frame.size.height, 200 * ScreenWidth, 30 * ScreenHeigth)];
    time.text = @"01-05 15:20";
    time.textColor = [UIColor colorWithRed:30 / 255.0 green:30 / 255.0 blue:30 / 255.0 alpha:1.0];
    time.font = [UIFont systemFontOfSize:15.0 * ScreenWidth];
    [self.contentView addSubview:time];

    
    
    
    
    
    
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
